1. Field of the Invention
The present invention generally relates to specifying texture header and texture sampler values for texture map operations.
2. Description of the Related Art
Execution of a texture fetch operation requires the specification of a texture header and a texture sampler which together describe the texture data (format and particular texture map) to be sampled and the filter to be applied to the sampled texture map to produce filtered texels for a pixel. Traditionally these have been specified by immediate values, meaning that the identity of the particular texture header and the particular texture sampler is static specified for the instruction at the time that a shader program including the texture fetch operation is compiled for execution by a processor.
When a graphics API such as Direct X 10 is used, a texture fetch instruction may not be used within an if-else statement. Therefore, different texture header and/or sampler may not be specified as inputs to a texture fetch operation in the “if” clause compared with a texture fetch operation in the “else” clause. Dynamic selection of different texture headers and/or samplers during execution of a shader program may not be possible.
Accordingly, what is needed in the art is a system and method for dynamically specifying a texture sampler and texture header for texture operations during execution of a shader program.